#region Copyright
/*
Copyright Notice: 
Use of this file, in source or binary form, is subject to the terms and conditions set forth 
in the included license.txt file.
*/
#endregion

/* This is a customised template.
 * It overrides some optional methods from EntityMap to allow for testing 
 * with Mocks and fast object creation. Search for #custom# below. 
 */


namespace WebbnessCMS.Security.Models
{

	#region Using statements

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Data;
	using Neo.Core;
	using Expergent;
	using Expergent.Neo;
	using Castle.Components.Validator;
		using Neo.Core.Util;
		using Neo.Framework;
			
	#endregion

	#region IUsersGroupsHierarchy

	/// <summary>
	/// Generated table specific Interface </summary>
	/// <remarks> This Interface is generated by the Neo Framework. Make changes to NeoSupport.vtl.</remarks>
	public partial interface IUsersGroupsHierarchy
	{
			
				/// <summary>
		/// Property ParentGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ParentGroupID.</remarks>
		/// <value> System.Guid. </value>
			System.Guid? ParentGroupID {get; set;}
	
					/// <summary>
		/// Property ChildGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ChildGroupID.</remarks>
		/// <value> System.Guid. </value>
			System.Guid? ChildGroupID {get; set;}
	
		
			/// <summary>
		/// Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		UsersGroup ParentGroup {get; set;}

			/// <summary>
		/// Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		UsersGroup ChildGroup {get; set;}

		}

	#endregion

	#region UsersGroupsHierarchy

	/// <summary>
	/// Generated table specific Base Class </summary>
	/// <remarks> This class is generated by the Neo Framework. Make changes to NeoSupport.vtl.</remarks>
	[Serializable]
	public partial class UsersGroupsHierarchy : RulesEnabledEntityObject, IUsersGroupsHierarchy
	{
	
			internal UsersGroupsHierarchy(System.Data.DataRow aRow, Neo.Core.ObjectContext aContext) : base(aRow, aContext)
		{
				}
		
				/// <summary>
		/// Property ParentGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ParentGroupID.</remarks>
		/// <value> System.Guid. </value>
				public virtual System.Guid? ParentGroupID
		{
			get { object v = Row["ParentGroupID"]; return (System.Guid?)((v != DBNull.Value) ? v : null); }
				set { if (value.HasValue) Row["ParentGroupID"] = value; else Row["ParentGroupID"] = DBNull.Value; }
				}    

					/// <summary>
		/// Property ChildGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ChildGroupID.</remarks>
		/// <value> System.Guid. </value>
				public virtual System.Guid? ChildGroupID
		{
			get { object v = Row["ChildGroupID"]; return (System.Guid?)((v != DBNull.Value) ? v : null); }
				set { if (value.HasValue) Row["ChildGroupID"] = value; else Row["ChildGroupID"] = DBNull.Value; }
				}    

		
			/// <summary>
		/// Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		public virtual UsersGroup ParentGroup
		{
			get { object fk = Row["ParentGroupID"]; return (fk == DBNull.Value) ? null : (UsersGroup)GetRelatedObject("Security_UsersGroups", fk); }
			set { SetRelatedObject(value, "ParentGroupID", "UsersGroupID" ); }
		}

			/// <summary>
		/// Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		public virtual UsersGroup ChildGroup
		{
			get { object fk = Row["ChildGroupID"]; return (fk == DBNull.Value) ? null : (UsersGroup)GetRelatedObject("Security_UsersGroups", fk); }
			set { SetRelatedObject(value, "ChildGroupID", "UsersGroupID" ); }
		}

				/// <summary>
		/// Returns the value associated with the propName parameter.</summary>
		/// <remarks> You will need to cast the returned object into its native type upon return.</remarks>
		/// <param name="propName">String property name.</param>
		/// <returns> System.Object. </returns>
		public override object GetProperty(string propName)
		{
					if(propName == "ParentGroupID") 
				return ParentGroupID;
						if(propName == "ChildGroupID") 
				return ChildGroupID;
						if(propName == "ParentGroup") 
				return ParentGroup;
				if(propName == "ChildGroup") 
				return ChildGroup;
					return ExtendGetProperty(propName);
		}
		
		/// <summary>
		/// Sets the value associated with the propName parameter to the value specified.
		/// </summary>
		/// <param name="propName">String property name.</param>
		/// <param name="value">The value.</param>
		public override void SetProperty(string propName, object value)
		{
						if(propName == "ParentGroupID") 
			{
				ParentGroupID = (System.Guid?)value;
				return;
			}
								if(propName == "ChildGroupID") 
			{
				ChildGroupID = (System.Guid?)value;
				return;
			}
							if(propName == "ParentGroup") 
			{
				ParentGroup = (UsersGroup)value;
				return;
			}
				if(propName == "ChildGroup") 
			{
				ChildGroup = (UsersGroup)value;
				return;
			}
				ExtendSetProperty(propName, value);
		}
		
		/// <summary>
		/// Adds a set of facts for this instance to the list.
		/// </summary>
		/// <param name="list">The list.</param>
		/// <param name="parent">The parent.</param>
		protected override void MakeFacts(List<WME> list, string parent)
		{
					list.Add(new WME(new EntityObjectTerm(this), MakePredicate(parent, "ParentGroupID"), ParentGroupID));
						list.Add(new WME(new EntityObjectTerm(this), MakePredicate(parent, "ChildGroupID"), ChildGroupID));
						list.Add(new WME(new EntityObjectTerm(this), MakePredicate(parent, "ParentGroup"), ParentGroup));
				list.Add(new WME(new EntityObjectTerm(this), MakePredicate(parent, "ChildGroup"), ChildGroup));
					ExtendMakeFacts(list, parent);
			myFactsHaveBeenAsserted = true;
		}

		/// <summary>
		/// Gets the default sort order.
		/// </summary>
		/// <value>The sort order.</value>
		public static PropertyComparer DefaultSortOrder
		{
			get
			{
					return new PropertyComparer("ParentGroupID", SortDirection.Ascending);
				}    
		}

			
		/// <summary>
		/// Populates the EntityObject from the specified surrogate.
		/// </summary>
		/// <param name="surrogate">The surrogate.</param>
		public void Populate(UsersGroupsHierarchySurrogate surrogate)
		{
							}
	}

	#endregion

	#region UsersGroupsHierarchyTemplate

	/// <summary>
	/// Generated table specific Query Template Class </summary>
	/// <remarks> A Query Template for UsersGroupsHierarchy operations. </remarks>
	public class UsersGroupsHierarchyTemplate : QueryTemplate
	{

		/// <summary>
		/// Constructor </summary>
		/// <remarks> Public Constructor.</remarks>
		/// <param name="anEntityMap">IEntityMap instance.</param>
		public UsersGroupsHierarchyTemplate(IEntityMap anEntityMap) : base(anEntityMap)
		{
		}
		
				/// <summary>
		/// Property ParentGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ParentGroupID.</remarks>
		/// <value> System.Guid. </value>
		public System.Guid ParentGroupID
		{
			get { return (System.Guid)QueryValues["ParentGroupID"]; }
			set { QueryValues["ParentGroupID"] = value; }
		}

					/// <summary>
		/// Property ChildGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ChildGroupID.</remarks>
		/// <value> System.Guid. </value>
		public System.Guid ChildGroupID
		{
			get { return (System.Guid)QueryValues["ChildGroupID"]; }
			set { QueryValues["ChildGroupID"] = value; }
		}

					/// <summary>
		/// Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Gets or sets the UsersGroup object.</remarks>
		/// <value> UsersGroup. </value>
		public UsersGroup ParentGroup
		{
			get { return (UsersGroup)QueryValues["ParentGroup"]; }
			set { QueryValues["ParentGroup"] = value; }
		}

			/// <summary>
		/// Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Gets or sets the UsersGroup object.</remarks>
		/// <value> UsersGroup. </value>
		public UsersGroup ChildGroup
		{
			get { return (UsersGroup)QueryValues["ChildGroup"]; }
			set { QueryValues["ChildGroup"] = value; }
		}

		               
	}

	#endregion

	#region UsersGroupsHierarchyFactory

	/// <summary>
	/// Factory class for the creation of UsersGroupsHierarchy objects.</summary>
	public class UsersGroupsHierarchyFactory : Neo.Framework.GenericObjectFactory<UsersGroupsHierarchy>
	{

		/// <summary>
		/// Constructor requiring an ObjectContext parameter.</summary>
		/// <remarks> Main entry point for the retrieval and creation of new UsersGroupsHierarchy objects.</remarks>
		/// <param name="context">ObjectContext.</param>
		public UsersGroupsHierarchyFactory(ObjectContext context) : base(context, typeof(UsersGroupsHierarchy))
		{
		}

			/// <summary>
		/// Create new UsersGroupsHierarchy object.</summary>
		/// <remarks>IdMethod = Guid, PrimaryKeyIsForeignKey = True, RelationshipSetsForColumns = 1.</remarks>
		/// <returns> UsersGroupsHierarchy </returns>
		public UsersGroupsHierarchy CreateObject()
		{
			return (UsersGroupsHierarchy)base.CreateObject(null);
		}
		
	
		/// <summary>
		/// Find a specified UsersGroupsHierarchy object.</summary>
		/// <remarks> Requires Primary Key values and/or parent object instances.</remarks>
			/// <param name="arg0">UsersGroup.</param>
			/// <param name="arg1">UsersGroup.</param>
			/// <returns> UsersGroupsHierarchy </returns>
		public UsersGroupsHierarchy FindObject(UsersGroup arg0, UsersGroup arg1)
		{
			return (UsersGroupsHierarchy)base.FindObject(new object[] { arg0.Row["UsersGroupID"], arg1.Row["UsersGroupID"] } );
		}

		///<summary>
		///Find a specified UsersGroupsHierarchy object.</summary>
		///<remarks> Requires Primary Key values and/or parent object instances.</remarks>
			///<param name="arg0">UsersGroup.</param>
			///<param name="arg1">UsersGroup.</param>
			///<returns> UsersGroupsHierarchy </returns>
		public UsersGroupsHierarchy FindObjectByPK( System.Guid arg0 , System.Guid arg1 )
		{
			return (UsersGroupsHierarchy) base.FindObject( new object[] {  arg0, arg1 } );
		}
		
								
			///<summary>
		///Find a specified UsersGroupsHierarchy object.</summary>
		///<remarks> Requires Primary Key values and/or parent object instances.</remarks>
			///<param name="arg0">UsersGroup.</param>
			///<param name="arg1">UsersGroup.</param>
			///<returns> UsersGroupsHierarchy </returns>
		public UsersGroupsHierarchy FindObjectByPK( System.Guid? arg0 , System.Guid? arg1 )
		{
			return (UsersGroupsHierarchy) base.FindObject( new object[] {  arg0.Value, arg1.Value } );
		}
			
		/// <summary>
		/// Return the correct Query Template for the UsersGroupsHierarchy object.</summary>
		/// <remarks> A query template is used for creating SQL like queries, in a more OO fashion.</remarks>
		/// <returns> UsersGroupsHierarchyTemplate </returns>
		public UsersGroupsHierarchyTemplate GetQueryTemplate()
		{
			return new UsersGroupsHierarchyTemplate(EntityMap);
		}
		
		/// <summary>
		/// SQL like query to find and return an object.</summary>
		/// <remarks> For example: ...FindFirst("TitleAuthors.(Title = {0} or Title.Publisher = {1})", title, publisher).</remarks>
		/// <param name="qualifierFormat">String.</param>
		/// <param name="parameters">params object[].</param>
		/// <returns> UsersGroupsHierarchy. </returns>
		public override UsersGroupsHierarchy FindFirst(string qualifierFormat, params object[] parameters)
		{
			ObjectList<UsersGroupsHierarchy> results = FindWithLimit(1, qualifierFormat, parameters);
			return (results.Count > 0) ? results[0] : null;
		}

		/// <summary>
		/// SQL like query to find and return an object.</summary>
		/// <remarks> For example: ...FindFirst("TitleAuthors.(Title = {0} or Title.Publisher = {1})", title, publisher).</remarks>
		/// <param name="q">The Qualifier.</param>
		/// <returns>UsersGroupsHierarchy</returns>
		public override UsersGroupsHierarchy FindFirst(Qualifier q)
		{
			FetchSpecification f = new FetchSpecification(EntityMap, q, 1);
			ObjectList<UsersGroupsHierarchy> result = Find(f);
			return result.Count > 0 ? result[0]: null;
		}
	}

	#endregion

	#region UsersGroupsHierarchyEntityMap

	//  -------- Entity Map -----------------------------------------------------
	/// <summary>Creates the in memory version of the dataset for the UsersGroupsHierarchy DOM.</summary>
	/// <remarks>Generated by Neo Framework.</remarks>
	internal class UsersGroupsHierarchyMap : EntityMap
	{
		  /// <summary>Array of Primary Key column names.</summary>
		  /// <remarks>Primary Key columns.</remarks>
		private static readonly string[] pkcolumns = { "ParentGroupID", "ChildGroupID" };
		/// <summary>Array of Database column names.</summary>
		  /// <remarks>Database column names.</remarks>
		private static readonly string[] columns = { "ParentGroupID", "ChildGroupID" };
		/// <summary>Array of DOM object properties.</summary>
		  /// <remarks>DOM object properties.</remarks>
		private static readonly string[] attributes = { "ParentGroupID", "ChildGroupID" };
		/// <summary>Array of Related Object names.</summary>
		  /// <remarks>Related Object names.</remarks>
		private static readonly string[] relations = { "ParentGroup", "ChildGroup" };

		private Type concreteObjectType = typeof(UsersGroupsHierarchy);

		  /// <summary>Property ObjectType.</summary>
		  /// <remarks>Returns the DOM's Type.</remarks>
		  /// <value>System.Type.</value>
		public override System.Type ObjectType
		{
			get { return typeof(UsersGroupsHierarchy); }
		}
	    
		/// <summary>Property ObjectType.</summary>
		  /// <remarks>Returns the DOM's Type.</remarks>
		  /// <value>System.Type.</value>
		public override System.Type ConcreteObjectType
		{
			get { return concreteObjectType; }										 /* #custom# overridden */
			set { concreteObjectType = value; Factory.AddCustomType(value, this); }  /* #custom# overridden */
		}
	    
		/// <summary>Property TableName.</summary>
		  /// <remarks>Returns database table name.</remarks>
		  /// <value>string.</value>
		public override string TableName
		{
			get { return "Security_UsersGroupsHierarchy"; }
		}
	    
		/// <summary>Property PrimaryKeyColumns.</summary>
		/// <remarks>Array of Primary Key column names.</remarks>
		/// <value>string[].</value>
		public override string[] PrimaryKeyColumns
		{
			get { return pkcolumns; }
		}

		/// <summary>Property Columns.</summary>
		/// <remarks>Array of Database column names.</remarks>
		/// <value>string[].</value>
		public override string[] Columns
		{
			get { return columns; }
		}

		/// <summary>Property Attributes.</summary>
		/// <remarks>Array of DOM object properties.</remarks>
		/// <value>string[].</value>
		public override string[] Attributes
		{
			get { return attributes; }
		}

		/// <summary>Property Relations.</summary>
		/// <remarks>Array of Related Object names.</remarks>
		/// <value>string[].</value>
		public override string[] Relations
		{
			get { return relations; }
		}

		/// <summary>Generates a Hashtable, keyed by Object Name, or information regarding related objects.</summary>
		/// <remarks>Related Objects.</remarks>
		/// <returns>IDictionary.</returns>
  		protected override IDictionary GetRelationInfos()
		{
    		IDictionary infos = new Hashtable(2);
	 	 			infos.Add("ParentGroup", new RelationInfo(Factory, typeof(UsersGroup), typeof(UsersGroupsHierarchy), "UsersGroupID", "ParentGroupID"));
			 			infos.Add("ChildGroup", new RelationInfo(Factory, typeof(UsersGroup), typeof(UsersGroupsHierarchy), "UsersGroupID", "ChildGroupID"));
					return infos;    	
		}
	    
		/// <summary>Based upon the model specified Id Method, returns the proper PkInitializer.</summary>
		/// <remarks>The object used to create a new PK value.</remarks>
		/// <returns>IPkInitializer.</returns>
		public override IPkInitializer GetPkInitializer()
		{
				return new GuidPkInitializer();
			}
	    
		/// <summary>Creates a new instance of UsersGroupsHierarchy.</summary>
		/// <remarks>Create new UsersGroupsHierarchy.</remarks>
		/// <param name="row">DataRow.</param>
		/// <param name="context">ObjectContext.</param>
		/// <returns>IEntityObject.</returns>
		public override IEntityObject CreateInstance(DataRow row, ObjectContext context) /* #custom# overridden */
		{
			if(ConcreteObjectType != ObjectType)
				return base.CreateInstance(row, context);
			return new UsersGroupsHierarchy(row, context);
		}
	    
		/// <summary>Generates the in memory dataset.</summary>
		/// <remarks>Called by the Factory object.</remarks>
		/// <param name="table">DataTable.</param>
		protected override void WriteBasicSchema(DataTable table)
		{
			DataColumn		c;
			
				c = table.Columns.Add("ParentGroupID", typeof(System.Guid));
											c = table.Columns.Add("ChildGroupID", typeof(System.Guid));
											table.PrimaryKey = new DataColumn[] { table.Columns["ParentGroupID"], table.Columns["ChildGroupID"] };
		}
		
			/// <summary>Generates the dataset relationships.</summary>
		/// <remarks>Dataset Relationships.</remarks>
		/// <param name="table">DataTable.</param>
		protected override void WriteRelations(DataTable table)
		{
			DataRelation r;
			
					if(table.DataSet.Relations["Security_UsersGroups*Security_UsersGroupsHierarchy.ParentGroupID"] == null)
			{
				r = table.DataSet.Relations.Add("Security_UsersGroups*Security_UsersGroupsHierarchy.ParentGroupID", 
						table.DataSet.Tables["Security_UsersGroups"].Columns["UsersGroupID"],
						table.DataSet.Tables["Security_UsersGroupsHierarchy"].Columns["ParentGroupID"]);
						r.ChildKeyConstraint.UpdateRule = Rule.None;
				r.ChildKeyConstraint.DeleteRule = Rule.Cascade;
				}
						if(table.DataSet.Relations["Security_UsersGroups*Security_UsersGroupsHierarchy.ChildGroupID"] == null)
			{
				r = table.DataSet.Relations.Add("Security_UsersGroups*Security_UsersGroupsHierarchy.ChildGroupID", 
						table.DataSet.Tables["Security_UsersGroups"].Columns["UsersGroupID"],
						table.DataSet.Tables["Security_UsersGroupsHierarchy"].Columns["ChildGroupID"]);
						r.ChildKeyConstraint.UpdateRule = Rule.None;
				r.ChildKeyConstraint.DeleteRule = Rule.Cascade;
				}
				}
		}

	#endregion

	#region UsersGroupsHierarchySurrogate

	/// <summary>Represents an entity object disconnected from the database.</summary>
	/// <remarks>
	///   <para>Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.</para>
	/// </remarks>
	public partial class UsersGroupsHierarchySurrogate : EntityObjectSurrogate, IUsersGroupsHierarchy
	{
		/// <summary>Default constructor.</summary>
		public UsersGroupsHierarchySurrogate()
		{
							}
	    
	    
	    
		/// <summary>
		/// Initializes a new instance of the <see cref="UsersGroupsHierarchySurrogate"/> class.
		/// </summary>
		/// <param name="entity">The entity.</param>
		public UsersGroupsHierarchySurrogate(UsersGroupsHierarchy entity)
		{
					ParentGroupID = entity.ParentGroupID;
						ChildGroupID = entity.ChildGroupID;
				}

	
		/// <summary>
		/// Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ParentGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		public virtual UsersGroup ParentGroup
		{
			get { return _ParentGroup; }
			set { _ParentGroup = value; }
		}
		
		private UsersGroup _ParentGroup;
		/// <summary>
		/// Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</summary>
		/// <remarks> Property ChildGroup - gets or sets the UsersGroup object with a one-to-one relationship to this instance.</remarks>
		/// <value> UsersGroup. </value>
		public virtual UsersGroup ChildGroup
		{
			get { return _ChildGroup; }
			set { _ChildGroup = value; }
		}
		
		private UsersGroup _ChildGroup;
	
		/// <summary>
		/// Updates the entity with the values contained within the surrogate.
		/// </summary>
		/// <param name="entity">The entity.</param>
		public void BindObjectInstance(UsersGroupsHierarchy entity)
		{
							}

					/// <summary>
		/// Property ParentGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ParentGroupID.</remarks>
		/// <value> System.Guid. </value>
			public System.Guid? ParentGroupID
		{
    		get {return _parentgroupid;}
				set {_parentgroupid = value;}
			}

		private System.Guid? _parentgroupid;
		
							/// <summary>
		/// Property ChildGroupID - No Description </summary>
		/// <remarks> Database Path: WebbnessCMS.Security_UsersGroupsHierarchy.ChildGroupID.</remarks>
		/// <value> System.Guid. </value>
			public System.Guid? ChildGroupID
		{
    		get {return _childgroupid;}
				set {_childgroupid = value;}
			}

		private System.Guid? _childgroupid;
		
			
			/// <summary>
		/// Property ParentGroupList - gets or sets a list of UsersGroup objects upon which this entity depends.</summary>
		/// <remarks> Used mostly to populate the select controls on the view side. Returns the list sorted by the default property, if one is defined.</remarks>
		/// <value> An ObjectList of  UsersGroup. </value>
		public ObjectList<UsersGroup> ParentGroupList
		{
    		get 
    		{
					if (_parentgroupList != null)
				{
					_parentgroupList.Sort("Name", SortDirection.Ascending);
				}
					return _parentgroupList;  
    		}
    		set {_parentgroupList = value;}
		}

		private ObjectList<UsersGroup> _parentgroupList;
			
			/// <summary>
		/// Property ChildGroupList - gets or sets a list of UsersGroup objects upon which this entity depends.</summary>
		/// <remarks> Used mostly to populate the select controls on the view side. Returns the list sorted by the default property, if one is defined.</remarks>
		/// <value> An ObjectList of  UsersGroup. </value>
		public ObjectList<UsersGroup> ChildGroupList
		{
    		get 
    		{
					if (_childgroupList != null)
				{
					_childgroupList.Sort("Name", SortDirection.Ascending);
				}
					return _childgroupList;  
    		}
    		set {_childgroupList = value;}
		}

		private ObjectList<UsersGroup> _childgroupList;
			
	
		/// <summary>
		/// Binds the surrogate values to the search template.
		/// </summary>
		/// <param name="emptyTemplate">The empty template.</param>
		public void BindToSearchTemplate(UsersGroupsHierarchyTemplate emptyTemplate)
		{
	
							if (this.ParentGroupID != null)
				emptyTemplate.ParentGroupID = this.ParentGroupID.Value;
							
									if (this.ChildGroupID != null)
				emptyTemplate.ChildGroupID = this.ChildGroupID.Value;
							}

	}
	#endregion

}

